package com.yuwenchao.superafflatus.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yuwenchao.superafflatus.pojo.entity.SuperShowColor;
import com.yuwenchao.superafflatus.mapper.SuperShowColorMapper;
import com.yuwenchao.superafflatus.service.SuperShowColorService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author ChaooGG
 * @since 2021-05-31
 */
@Service
public class SuperShowColorServiceImpl extends ServiceImpl<SuperShowColorMapper, SuperShowColor> implements SuperShowColorService {

    @Override
    public IPage getSuperColorPage(String coloeName, Page page) {

        QueryWrapper<SuperShowColor> showColorQueryWrapper = new QueryWrapper<>();
        showColorQueryWrapper.like(StringUtils.isNoneBlank(coloeName),"chinese_desc",coloeName);
        IPage iPage = baseMapper.selectPage(page, showColorQueryWrapper);

       return iPage;

    }
}
